Repository navigation
refine the docker-compose config - #399
Conversation
The web service in docker-compose.yml creates an image named "operationcodebackend_web". Much like the bundle service is configured to reuse that already-built image, this configures the sidekiq service to also reuse web. No need to also build a sidekiq image which takes up time and disk space. Signed-off-by: Robb Kidd <robb@thekidds.org>
The web service is updated to bind port 3000 to the loopback interface (e.g. localhost) only, not all interfaces. No need to share your development backend API to the whole coffee shop. Signed-off-by: Robb Kidd <robb@thekidds.org>
|
And the Curses. |
8ccb5bc to
8223ef3
Compare
|
Removed the commit that added PG and Redis host loopback port binding. |
|
Could you explain the PG/ Redis host loopback port binding? |
Certainly! (Though at the time of this writing, that change is not present in the commits in this PR.) Basically, it would allow a dev to continue to run PG and Redis in Docker and have the option to run the Ruby/Railsy bits on their host OS, e.g. It broke in Travis because the Travis builder has PostgreSQL already running so ports conflicted. There are a couple options to resolve that if everyone agrees that this flexibility of where a dev can run Ruby is worth it. This could be a step along the path of supporting a more native dev environment (#361). Details operationcode-psql:
image: postgres
+ ports:
+ - "127.0.0.1:5432:5432"
env_file:
- .env
redis:
image: redis:latest
+ ports:
+ - "127.0.0.1:6379:6379"With this change and a clean docker-compose, I can do the standard setup. What is left running is only the PG database and Redis. Note the ports. My desktop host's |
Description of changes
localhost) to avoid sharing your development backend with everyone in the coffee shopupdate the PG and Redis services to also bind their ports to host's loopback to allow devs to run the Ruby bits on the host OS while reusing the docker'd database and Redis store(removed from this PR because of port conflicts in Travis)Each of these bullets were added in separate commits, so each change is reviewable in isolation from the others.